package com.example.administrator.hqq.activity.drag;

import android.annotation.SuppressLint;

import android.os.Bundle;

import android.support.annotation.Nullable;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;



import com.bumptech.glide.Glide;
import com.example.administrator.hqq.R;
import com.example.administrator.hqq.base.MyFragemnt;


import butterknife.BindView;
import butterknife.ButterKnife;
import io.rong.photoview.PhotoView;


@SuppressLint("ValidFragment")
public class PhotoFragment extends MyFragemnt {

    @BindView(R.id.photo_view)
    PhotoView mPhotoView;
    private String mUrl;

    public PhotoFragment(String url) {
        mUrl = url;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.layout_photo_view, container, false);
        ButterKnife.bind(this, view);
        loadData();
        return view;
    }

    protected void loadData() {
        initView();

    }

    private void initView() {

        Glide.with(getActivity())
                .load(mUrl)
                .into(mPhotoView);
        mPhotoView.setClickable(true);
    }
}
